<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>智享停车管理系统</title>
    <link type="text/css" rel="stylesheet" href="/css/reglog.css" />
    <link type="text/css" rel="stylesheet" href="/css/layout_a.css" />
    <link type="text/css" rel="stylesheet" href="/css/modalwindow.css" />
    <script src="/js/html5shiv.js"></script>
    <script src="/js/jquery.min.js"></script>
    <script src="/js/jquery.modalwindow.js"></script>
    <script src="/js/common.js"></script>
    
    <script type="text/javascript" src="/js/jquery.livequery.js"></script>
	<script type="text/javascript" src="/js/jquery.validate.js"></script>
	<script type="text/javascript" src="/js/jquery.validate.extend.js"></script>
	
	<style type="text/css">
		label.error{
			padding: 2px 10px 2px 10px!important;
			height: 30px !important;
			line-height:30px;
			color: #FFFFFF !important;
			width: 120px !important;
		}
		
		label.error:before{
			top:8px !important;
		}
	</style>
	
</head>
<body>
    <section class="outerwrap">
        <div class="wrap wrap-login" id='login'>
            <div class="inner">
                <div class="title">
                    <img src="images/icon-laptop.png" />
                    <h3>智享停车管理系统</h3>
                </div>
                <form id="form">
                    <div class="inputwrapper">
                        <label for="userName">用户名</label>
                        <input id="userName" name="userName" data-vdt="required"/>
                        <a href="view/register">注册用户</a>
                    </div>
                    <div class="inputwrapper">
                        <label for="password">密　码</label>
                        <input id="password" name="password" data-vdt="required" type="password"/>
                        <a href="#">找回密码</a>
                    </div>
                    <!-- 
                   	<div class="inputwrapper">
                   		<label style="vertical-align: middle;height: 70px">验证码</label>
                   		<input id="account" name="account" data-vdt="required" style="width: 100px;" maxlength="6"/>
                   		<img alt="验证码" onclick = "this.src='/defaultKaptcha?d='+new Date()*1" src="/defaultKaptcha" style="float:right;"/>
                   	</div>
                   	 -->
                   	<div style="margin-left: 120px;vertical-align: middle;display: none;">
                    	<label style="color: #FF0000">error</label>
                    </div>
                    <button class="submitBtn" type="button" onclick="javascript: login();"><i class="icon-circle-arrow-right"></i> 登录系统</button>
                </form>
            </div>
        </div>
    </section>
    
	</script>
    <footer>
        <p class="version">北京聚合众力科技有限公司 SYSTEM VERSION 1.0</p>
        <p class="copyright">&copy; COPYRIGHT BY HUAQING TECHNOLOGY CO.,LTD</p>
    </footer>
</body>
<script type="text/javascript">
	function login(){
		$.ajax({
            type: "POST",
            url: "/view/login",
            data: $("#form").serialize(),
            dataType : "json",
            beforeSend : function(){
            	$("#beforeLoading").show();
            	timeOutHint();
            },
            success: function (res) {
            	$("#beforeLoading").hide();
            	if(res.resData.status){
            		window.location.href="/web/settings/index";
            	}
            	else{
            		failHint();
            	}
            	
            },
            error: function (msg) {
            	failHint();
            }
        });
	}
</script>
</html>
